<?php

include("conn.php");

$state = 2;
$errinfo = "";  

$account = $_POST["account"];
$password = $_POST["password"];

$sql = "select * from user where user = '".$account."' and password = '".$password."' ";
$query = mysql_query($sql);
$row = mysql_affected_rows();
if($row>0){
    $state = 1;
    
}else{
    
    $errinfo = "账号或密码错误！";
}


$resultArray = array();
$resultArray["state"] = $state; 
$resultArray["errinfo"] = $errinfo;

echo json_encode($resultArray);

?>